<template>
	<view :class="item.istop?'bg-light':'bg-white'" hover-class="bg-light">
		

<view class="flex align-stretch"  @click="onclick" @longpress="long">
			<view class="flex align-center justify-center position-relative" style="width: 145rpx;">
			<!-- 	<image :src="item.avator" class="rounded" mode="widthFix" style="width: 92rpx;height: 92rpx;">
				</image> -->
				<free-avater :src="item.avatar" size="90" class="rounded"></free-avater>
				<!-- <free-bedge v-if="item.noreadnum">{{item.noreadnum}}</free-bedge> -->
				<!-- <free-bedge>{{item.noreadnum}}</free-bedge> -->
				<text v-if="item.noreadnum!==0" class="bg-danger text-white rounded-circle font-sm position-absolute" style="padding: 6rpx 14rpx;box-sizing: border-box;right: 15rpx;top: 15rpx;">
				{{item.noreadnum}}
					
				</text>
			</view>
			<view class="flex flex-column border-bottom flex-1 py-3 pr-3 border-bottom">
				<view class="flex align-center justify-between mb-1">
					<text class="font-md">{{item.name}}</text>
					<text class="font-sm text-light-muted">{{item.update_time?item.update_time:item.updated_at|formatTime}}</text>
				</view>
				<text class="text text-ellipsis text-light-muted">{{item.data}}</text>
			</view>
		</view>
			</view>
</template>

<script>
	import freeBase from "@/common/mixin/free-base.js"
	import freeAvater from "@/components/free-ui/free-avater.vue"
	import freeBedge from "@/components/free-ui/free-bedge.vue"

	export default{
		mixins:[freeBase],
		components: {
			
			freeAvater,
			freeBedge
		},
		props:{
			item:Object,
			index:Number
		},
		
		
		methods:{
			onclick(e){
				console.log(e,"e");
				this.$emit("click")
				console.log("点击事件");
			},
			long(e){
				console.log(e,"e");
				let x=0;
				let y=0;
				// #ifndef APP-PLUS-NVUE
				if(Array.isArray(e.changedTouches)&&e.changedTouches.length>0){
				x=e.changedTouches[0].screenX
							y=e.changedTouches[0].screenY
				}
				
				// #endif
				// #ifdef MP
				x=e.detail.x;
				y=e.detail.y
				// #endif
				this.$emit('long',{x,y,index:this.index,item:this.item})
			},
		}
	}
</script>

<style>
</style>